<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	template="Layout.xhtml">

<ui:define name="metadata">
<f:event listener="#{sessionBean.isLoggedIn}" type="preRenderView" />
</ui:define>

		<ui:define name="content">
			<h:form>
				<p:panel id="panel" header="Event buchen">
					<p:messages />
					<h:panelGrid columns="2" columnClasses="column" cellpadding="5">
						<h:outputLabel value="Name: " />
						<h:outputText value="#{sessionBean.selectedEvent.name}" />
						<h:outputLabel value="Datum: " />
						<h:outputText value="#{sessionBean.selectedEvent.date}" />
						<h:outputLabel value="Genre: " />
						<h:outputText value="#{sessionBean.selectedEvent.genre}" />
						<h:outputLabel value="Ort: " />
						<h:outputText value="#{sessionBean.selectedEvent.location}" />
						<h:outputLabel value="Verfügbare Tickets: " />
						<h:outputText
							value="#{sessionBean.selectedEvent.availableTickets}" />
						<h:outputLabel value="Preis pro Ticket: " />
						<h:outputText value="#{sessionBean.selectedEvent.pricePerTicket}" />
						<p:inputText id="slider" value="#{bookEvent.bookingCount}" rendered="#{!sessionBean.eventBooked}" />
						<p:slider for="slider" step="1" minValue="1" maxValue="5" rendered="#{!sessionBean.eventBooked}" />
						<h:outputText value="Schon gebucht!" rendered="#{sessionBean.eventBooked}"/>
					</h:panelGrid>
					<p:commandButton id="commandBtn" value="Buchen"
						action="#{bookEvent.submit}" update="panel" rendered="#{!sessionBean.eventBooked}"/>
				</p:panel>
			</h:form>
		</ui:define>
</ui:composition>